<script xmlns="http://www.w3.org/1999/html" setup>
import {ref, reactive, watch} from "vue";

  name='WatchParam'
    const  count=ref(0);
    const  clickTimes=ref(0);
     function button(){
      clickTimes.value++;
      console.log(clickTimes)
    }
    //监听普通变量：
    watch(clickTimes,(newV,OldV)=>{
      count.value=newV
      console.log(count)
    })

</script>

<template>
  <button @click="button">点击这个 +1</button>
  <br/>
  <h3>{{clickTimes}}</h3>
  <br/>
  <h3>{{count}}</h3>
</template>

<style scoped>

</style>
